#pragma once
#include <graphics.h>
#include <functional>
#include <memory>
#include <string>

namespace Ui
{
	class Button
	{
	public:
		Button(int index);
		void IsHit(int x, int y, int DOWN = 0);

		inline int GetIndex() const { return m_Index; }
		inline void Bind(const std::function<void()>& func) { OnHit = func; }

	private:
		std::function<void()> OnHit;

		std::shared_ptr<IMAGE> m_Sprite0;
		std::shared_ptr<IMAGE> m_Sprite1;

		int m_Index;
		
		int m_Height;
		int m_Width;

		int m_Xpos;
		int m_Ypos;

		int m_IsPress;
	};

	void CreateUi();
}